#lang rosetta-racket


(require "truss.rkt")

(provide arc-truss)


(define (arc-cs c r phi th1 th2 dth)
  (map (λ (th) (+sph c r phi th)) (: < th1 .. dth .. th2 <)))

(define (arc-surface-cs c ra rb phi th1 th2 e n)
  (let ((dth (/ (- th2 th1) n)))
    (list
     (arc-cs (+pol c (/2 e) (+ phi pi/2)) ra phi th1 th2 dth)
     (arc-cs c rb phi (+ th1 (/2 dth)) (- th2 (/2 dth)) dth)
     (arc-cs (+pol c (/2 e) (- phi pi/2)) ra phi th1 th2 dth))))

(define (arc-truss c ra rb phi th1 th2 e n)
  (spatial-truss (arc-surface-cs c ra rb phi th1 th2 e n)))

; another possible definition (define arc-truss (λ. spatial-truss arc-truss))